from django.shortcuts import render
from django.views import View

from apps.index.utils import get_user
from apps.users.models import User


class InfoCenterView(View):
    def get(self, request):
        context = {
        }
        try:
            username = get_user(request)
            user_obj = User.objects.get(username=username)
            context["user_obj"] = user_obj
            context["username"] = user_obj.username
        except:
            return render(request, "404.html")

        return render(request, "info.html", context=context)
